package cn.cs.service;

import cn.cs.mapper.RepairBbsTypeMapper;
import cn.cs.pojo.RepairBbsType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class RepairBbsTypeService {

    @Resource
    private RepairBbsTypeMapper repairBbsTypeMapper;

    @RequestMapping(value = "/getRepairBbsTypeById", method = RequestMethod.POST)
    public RepairBbsType getRepairBbsTypeById(@RequestParam("id") String id) throws Exception{
        return repairBbsTypeMapper.getRepairBbsTypeById(id);
    }

    @RequestMapping(value = "/getRepairBbsTypeListByMap", method = RequestMethod.POST)
    public List<RepairBbsType> getRepairBbsTypeListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return repairBbsTypeMapper.getRepairBbsTypeListByMap(param);
    }

    @RequestMapping(value = "/getRepairBbsTypeCountByMap", method = RequestMethod.POST)
    public Integer getRepairBbsTypeCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return repairBbsTypeMapper.getRepairBbsTypeCountByMap(param);
    }

    @RequestMapping(value = "/addRepairBbsType", method = RequestMethod.POST)
    public Integer addRepairBbsType(@RequestBody RepairBbsType repairBbsType) throws Exception{
        return repairBbsTypeMapper.insertRepairBbsType(repairBbsType);
    }

    @RequestMapping(value = "/modifyRepairBbsType", method = RequestMethod.POST)
    public Integer modifyRepairBbsType(@RequestBody RepairBbsType repairBbsType) throws Exception{
        return repairBbsTypeMapper.updateRepairBbsType(repairBbsType);
    }

    @RequestMapping(value = "/deleteRepairBbsTypeById", method = RequestMethod.POST)
    public Integer deleteRepairBbsTypeById(@RequestParam("id") String id) throws Exception{
        return repairBbsTypeMapper.deleteRepairBbsTypeById(id);
    }


}
